from enum import Enum, unique


@unique
class WeekDay(Enum):
    Sun = 0  # Sun的value被设定为0，每个枚举类的成员中都有两个属性：枚举成员名、枚举成员值
    Mon = 1
    Tue = 2
    Wed = 3
    Thu = 4
    Fri = 5
    Sat = 6


weekday = WeekDay.Sun.name  # 通过 ‘ . '可以来访问枚举类的成员变量
print(weekday)
weekday = WeekDay.Sun.value
print(weekday)
